﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/Main.Master" AutoEventWireup="true"
    CodeBehind="UserManage.aspx.cs" Inherits="AUV5.Web.Manage.UserManage" %>

<%@ Import Namespace="AUV5.Model" %>
<%@ Import Namespace="AUV5.BLL" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h3>设置管理员</h3>
    <fieldset>
        <p>
            用户名：<asp:TextBox ID="txtManager" runat="server" /> 
            <asp:Button ID="btnSetManager" Text="设置" runat="server" OnClick="btnSetManager_Click" />
            <asp:Label ID="lbMessage" class="error" Text="" runat="server" />
        </p>
    </fieldset>
    <h3>
        用户管理</h3>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <td>
                用户名（真实姓名）
            </td>
            <td>
                角色
            </td>
            <td>
                创建时间
            </td>
            <td>
                最后登录时间
            </td>
            <td align="center">
                管理
            </td>
        </tr>
        <asp:Repeater ID="repUser" runat="server">
            <ItemTemplate>
                <tr>
                    <td>
                        <%#(Container.DataItem as UserInfo).UserName %>
                        <%#(Container.DataItem as UserInfo).RealName.Trim() == "" ? "" : "("+(Container.DataItem as UserInfo).RealName+")"%>
                    </td>
                    <td>
                        <%#RoleInfoBLL.Instance.GetRoleName((Container.DataItem as UserInfo).RoleID)%>
                    </td>
                    <td>
                        <%#(Container.DataItem as UserInfo).CreateDate.ToString("yyyy-MM-dd HH:mm") %>
                    </td>
                    <td>
                        <%#(Container.DataItem as UserInfo).LastLogin.ToString("yyyy-MM-dd HH:mm")%>
                    </td>
                    <td class="action">
                        <asp:LinkButton ID="lbtnState" Text='通过' Visible='<%#((Container.DataItem as UserInfo).State==(int)AUV5.Common.Enum.auvState.Enabled)?false:true%>'
                            CommandArgument="<%#(Container.DataItem as UserInfo).UserID %>" runat="server"
                            OnClick="lbtnState_Click" class="edit" />
                        <a href="/<%#(Container.DataItem as UserInfo).UserName %>" class="view" target="_blank">查看详细</a>
                            <asp:LinkButton ID="lbtnDel" Text='<%#((Container.DataItem as UserInfo).IsDel==(int)AUV5.Common.Enum.auvDel.NotDel)?"禁用":"启用"%>'
                            CommandArgument="<%#(Container.DataItem as UserInfo).UserID %>" CommandName='<%#((Container.DataItem as UserInfo).IsDel==(int)AUV5.Common.Enum.auvDel.NotDel)?"Disable":"Enable"%>'
                             runat="server" OnClick="lbtnDel_Click" class="delete" />
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr>
            <td colspan="5">
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" FirstPageText="首页" LastPageText="尾页"
                    NextPageText="后页" PagingButtonLayoutType="Span" PrevPageText="前页" SubmitButtonText="Go"
                    TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" OnPageChanged="AspNetPager1_PageChanged">
                </webdiyer:AspNetPager>
            </td>
        </tr>
    </table>
    <br />
</asp:Content>
